home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11802 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1020 b   |  48 lines

  1. Path: inforamp.net!ts14-03
  2. From: rmorin@inforamp.net (Randy Charles Morin)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: BC++45 Class Question
  5. Date: Sat, 16 Mar 96 08:33:33 GMT
  6. Organization: MiddleWorld SoftWare
  7. Message-ID: <4idudf$pc1@sam.inforamp.net>
  8. References: <4ic1r8$r1c@news1.infinet.com>
  9. NNTP-Posting-Host: ts14-03.tor.inforamp.net
  10. X-Newsreader: News Xpress Version 1.0 Beta #4
  11.  
  12. In article <4ic1r8$r1c@news1.infinet.com>,
  13.    cedwards@infinet.com (Chad Edwards) wrote:
  14. >TDrawView is of TFileView.
  15. >What I want to do, is set the dirty flag to true when this function is 
  16. >executed. However, the SetDirty function is of another class.
  17. >Is there a way to do this?
  18.  
  19. TFileView?  Anyhow, if you have a TView (or a class derived from TView), then 
  20. you simply
  21.  
  22. class TDrawView : public TView (or a class derived from TView)
  23. {
  24. ..
  25. };
  26.  
  27. TMyView::CmAdd()
  28. {
  29.     GetDocument().SetDirty();
  30.     ...
  31. };
  32.  
  33. class TMyDoc : public TDocument
  34. {
  35. ..
  36. public:
  37.     void SetDirty();
  38. };
  39.  
  40. TMyDoc::SetDirty()
  41. {
  42.     DirtyFlag = true;
  43. };
  44.  
  45. I hope this helps.
  46.  
  47. Agrivar
  48.